package guestbook

import (
	"tacitus/contract"
	"tacitus/library"
	"tacitus/library/database"
	serv "tacitus/library/services"
	"xorm.io/xorm"
)

var x *xorm.Engine
var u contract.IUser

func init() {
	x = db.Use("site")

	if lib.Config.Develop.Sync {
		if err := x.Sync2(new(Guestbook)); err != nil {
			panic(err)
		}
	}

	u = new(contract.User)  // 默认使用远程服务的客户端
	serv.Direct("User", &u) // 如果本地有用户服务注册，则自动替换为本地
}

